# point class location class
class Edge:
    def __init__(self, p1, p2):
        self.p1 = p1
        self.p2 = p2
        self.len = 0
    
    #Return the first point of the edge
    def getP1(self):
        return self.p1
    
    #Return the second point of the edge
    def getP2(self):
        return self.p2
        
    #Returns length of the edge
    def getLen (self):
        if (self.len == 0):
            self.len = pow (pow(self.p1.getX() - self.p2.getX(), 2)
                        + pow(self.p1.getY() - self.p2.getY(), 2 ), 0.5)
        return self.len
            
                